{template 'public/header'}

{template 'public/comhead'}

<link rel="stylesheet" type="text/css" href="../addons/yzzc_sun/template/public/ygcsslist.css">
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li  {if $type=='all'} class="active" {/if}><a href="{php echo $this->createWebUrl('branchslist',array('type'=>all));}">车辆收益</a></li>
</ul>
<br>
<div class="row ygrow">
    <div class="col-lg-12">

        <form class="form-inline" action="" method="get">
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="yzzc_sun" />
            <input type="hidden" name="do" value="exterior" />
            <input type="hidden" name="token" value="{$_W['token']}"/>
            <div class="form-group">
                <label for="keyword">关键词</label>
                <input type="text" class="form-control" name="keywords" id="keyword" value="{$keywords}" placeholder="请输入车牌、车辆名称">
            </div>
            <div class="form-group">
                <label for="status">创建时间</label>
                {php echo tpl_form_field_daterange('range_time',array('start'=>date('Y-m-d H:i', $start_time),'end'=>date('Y-m-d H:i', $end_time)),true);}
            </div>
            <input type="submit"  name="submit"  value="搜索" class="btn btn-default">
        </form>

        <div class="col-md-4">
            <input type="hidden" name="token" value="{$_W['token']}"/>
        </div>
    </div><!-- /.col-lg-6 -->
</div>
<div class="row ygrow">
    <div class='col-lg-12'>
        <li><p style="margin-top: 6px;">总成本：<label style="color: red">{$total_cost_money}</label></p></li>
        <li><p style="margin-top: 6px;">总利润：<label style="color: red">{$total_profit_}</label></p></li>
    </div>
</div>
<div class="row ygrow">
    <div class='col-lg-12'>
        <a data-toggle="modal" data-target="#myModalLabelAdd"><button class="btn btn-sm store-blue">添加外调</button></a>
<!--        <a data-toggle="modal" data-target="#myModalsss"><button class="btn btn-sm store-blue">导出客户租车信息</button></a>-->
    </div>
</div>
<!--手续费-->
<div class="modal fade" id="myModalLabelAdd" tabindex="-1" role="dialog" aria-labelledby="myModalLabelAdd">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="fee" style="font-size: 20px;">添加外调</h4>
            </div>
            <form action="" method="post" >
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="yzzc_sun" />
                <input type="hidden" name="do" value="exterior" />
                <input type="hidden" name="op" value="add" />
                <input type="hidden" name="status" value="1" />
                <div class="modal-body" style="font-size: 20px;padding: 15px">
                    <input type="text" name="car_name" placeholder="请输入车辆名称"  class="form-control"/>
                </div>
                <div class="modal-body" style="font-size: 20px;padding: 15px">
                    <input type="text" name="car_num" placeholder="请输入车牌号"  class="form-control"/>
                </div>
                <div class="modal-body" style="font-size: 20px;padding: 15px">
                    <input type="text" name="sales_price" placeholder="请输入发车客户价"  class="form-control"/>
                </div>
                <div class="modal-body" style="font-size: 20px;padding: 15px">
                    <input type="text" name="money" placeholder="请输入外调租金"  class="form-control"/>
                </div>
                <div class="modal-body" style="font-size: 20px;padding: 15px">
                    <input type="text" name="exceed_km" placeholder="请输入超公里"  class="form-control"/>
                </div>
                <div class="modal-body" style="font-size: 20px;padding: 15px">
                    <input type="text" name="gasoline_subsidy_cost" placeholder="请输入油费补"  class="form-control"/>
                </div>
                <div class="modal-body" style="font-size: 20px;padding: 15px">
                    <input type="text" name="car_damage_cost" placeholder="请输入车损"  class="form-control"/>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <input type="submit" class="btn btn-info" name="submit" value="确定"/>
                </div>
                <input type="hidden" name="token" value="{$_W['token']}"/>
            </form>
        </div>
    </div>
</div>

<div class="modal fade" id="myModalsss" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">客户租车信息导出</h4>
            </div>
            <form action="" method="get" >
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="yzzc_sun" />
                <input type="hidden" name="do" value="goods_income" />
                <input type="hidden" name="branch_id" value="{$branch_id}" />
                <input type="hidden" name="keywords" value="{$keywords}" />
                <input type="hidden" name="op" value="export_order" />
                <div class="modal-body" style="font-size: 20px">
                    <span>
                    即将导出所有订单？
                    </span>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <input type="submit" class="btn btn-info" name="submit" value="确定"/>
                </div>
                <input type="hidden" name="token" value="{$_W['token']}"/>
            </form>
        </div>
    </div>
</div>
<div class="main ">

    <div class="panel panel-default" >
        <div class="panel-heading">
            收益列表
        </div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row" id="accordion">
                <table class="yg5_tabel col-md-12 table-hover">
                    <tr class="yg5_tr1">
                        <td class="store_td1 ">名称</td>
                        <td>车牌</td>
                        <td>发车客户价</td>
                        <td>外调租金</td>
                        <td>油补</td>
                        <td>超公里</td>
                        <td>车损</td>
                        <td>总成本</td>
                        <td>利润</td>
                        <td>创建时间</td>
                    </tr>

                    {loop $info $key $item}
                    <tbody>
                    <tr class="yg5_tr2" >
                        <td>{$item['car_name']}</td>
                        <td>{$item['car_num']}</td>
                        <td>{$item['sales_price']}</td>
                        <td>{$item['money']}</td>
                        <td>{$item['gasoline_subsidy_cost']}</td>
                        <td>{$item['exceed_km']}</td>
                        <td>{$item['car_damage_cost']}</td>
                        <td>{$item['total_cost_money']}</td>
                        <td>{$item['total_profit']}</td>
                        <td>{$item['createtime']}</td>
                    </tr>
                    </tbody>
                    {/loop}
                    {if empty($info)}
                    <tr class="yg5_tr2">
                        <td colspan="8">
                            暂无收益信息
                        </td>
                    </tr>
                    {/if}
                </table>
            </div>
        </div>

    </div>
    </form>
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-7").show();
        $("#yframe-7").addClass("wyactive");
    })
    function del(id) {
        var ret = confirm("删除前请确认该门店所有车辆均已下架，您确定删除吗？")
        if (ret==true){
            $.ajax({
                type:"POST",
                url:"/web/index.php?c=site&a=entry&op=delete&do=branchslist&op=delete&module_name=yzzc_sun&version_id=1",
                dataType:"JSON",
                data:{id:id},
                success:function(res){
                    console.log(res);
                    location.reload();
                    // if(res.status == 1) {
                    //     layer.msg(res.message, {icon: 1});
                    //     location.href ="{php echo $this->createWebUrl('renting')}";
                    // }else{
                    //     layer.msg(res.message, {icon: 6});
                    //     location.href =res.url;
                    // }
                }
            })
        }
    }
</script>